#include <iostream>

class Example
{
private:
    int num;
    double d;

public:
    // 使用初始化列表的构造函数
    Example() : num(0), d(0.0)
    {
        std::cout << "Default constructor with initialization list called" << std::endl;
    }

    // 带参数的构造函数，使用初始化列表
    Example(int n, double val) : num(n), d(val)
    {
        std::cout << "Parameterized constructor with initialization list called" << std::endl;
    }

    void display()
    {
        std::cout << "num: " << num << ", d: " << d << std::endl;
    }
};

int main()
{
    Example obj1;
    obj1.display();

    Example obj2(10, 3.14);
    obj2.display();

    return 0;
}